package com.shenyang.dao;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;

public class Word extends HttpServletRequestWrapper {
    //就一个方法没有必要写成接口
	public Word(HttpServletRequest request) {
		super(request);
		
	}

	@Override
	public String getParameter(String name) {
		 String arr = super.getParameter(name);
         System.out.println("要过滤的文本："+arr);
         List<String> list = new ArrayList<>();
         list.add("傻子");
         list.add("傻");
         list.add("混蛋");
         for (String s : list) {
             arr = arr.replaceAll(s, "*");
             System.out.println("容器中所提供的敏感词:" + s);
         }
         return arr;

	}
    
	
	
}
